﻿<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery('@ID("#btn_add_file")').click(function (event) {
            event.preventDefault();
            jQuery('@ID("#file_list")').append('<li><input type="file" name="files" /></li>');
        });
        jQuery.ajax({
            type: 'post',
            url: '@Url.Action(Loc.Act("Storages"))',
            dataType: 'json',
            success: function (rsp) {
                var ddl = jQuery('@ID("#ddl_storage")');
                ddl.empty();
                jQuery.each(rsp, function (k, v) {
                    ddl.append('<option value=' + v.id + '>' + v.value + '</option>');
                });
            }
        });
    });
</script>
<form class="common-form" id="@ID("form")" action="@Url.Action(Loc.Act("Upload").Localized())" method="post" enctype="multipart/form-data">
    <ul>
        <li>
            <select id="@ID("ddl_storage")" name="storageID"></select>
        </li>
    </ul>
    <ul id="@ID("file_list")">
        <li><input type="file" name="files" /></li>
        <li><input type="file" name="files" /></li>
        <li><input type="file" name="files" /></li>
    </ul>
    <ul class="bar toolbar">
        <li><button id="@ID("btn_add_file")" class="button">+</button></li>
        <li><button class="button" type="submit">@T(Res.In("Common").Of("Act").Name("Submit"))</button></li>
    </ul>
</form>
